feat: add explainSolTransaction using @bitgo/wasm-solana#7957
Open
feat: add explainSolTransaction using @bitgo/wasm-solana#7957
Conversation
d32c089 to
bb885ad
Compare
f5732ce to
97c511d
Compare
OttoAllmendinger
requested changes
Feb 11, 2026
Contributor
OttoAllmendinger
left a comment
There was a problem hiding this comment.
we can move towards bigint a little bit more
where external interfaces force us to string keep it
38e4bc7 to
da3dc95
Compare
0b3225b to
3cb4054
Compare
OttoAllmendinger
requested changes
Feb 13, 2026
Contributor
OttoAllmendinger
left a comment
There was a problem hiding this comment.
counting on you claude
3cb4054 to
009f956
Compare
c071f3c to
e1a4c9d
Compare
01ddba7 to
9400a94
Compare
a59880d to
9e38c95
Compare
OttoAllmendinger
previously approved these changes
Feb 18, 2026
Add a standalone `explainSolTransaction()` function that calls @bitgo/wasm-solana's `explainTransaction()` directly and resolves token names via `@bitgo/statics`. This is a thin adapter (~40 lines) that: - Converts wasm-solana's bigint amounts to strings at the boundary - Resolves mint addresses to token names via @bitgo/statics - Maps to the existing TransactionExplanation interface No legacy code is modified. The adapter coexists alongside the existing Transaction class and builders. For tsol (testnet), explainTransaction() routes through the WASM adapter. For sol (mainnet), the legacy builder path is preserved. Changes: - sol.ts: add explainSolTransaction() + explainTransactionWithWasm() - iface.ts: add inputs, feePayer, ataOwnerMap to TransactionExplanation - instructionParamsFactory.ts: export findTokenName (used by adapter) - package.json: add @bitgo/wasm-solana dependency - webpack config: add WASM asset handling - New tests: Jito WASM verification + explain tests for all tx types BTC-3025 TICKET: BTC-0
Route tsol transactions through the WASM-based explainSolTransaction() in Transaction.explainTransaction(), validating the WASM path against production traffic before replacing the legacy implementation for all networks. Changes: - transaction.ts: tsol uses explainSolTransaction() instead of the legacy switch/case block (no @solana/web3.js dependency) - explainTransactionWasm.ts: add StakingAuthorizeRaw type mapping and stakingAuthorize field support for full parity with legacy - explainTransactionWasm.ts: return fee '0' with feeRate undefined when feeInfo is not provided (matches downstream expectations) - Update test assertions for WASM output shape (ataOwnerMap, fee values, unresolvable token names) BTC-0 TICKET: BTC-0
9e38c95 to
c676e77
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add a standalone
explainSolTransaction()function tosdk-coin-solthat uses@bitgo/wasm-solanato explain Solana transactions without depending on@solana/web3.js.This is a thin ~100-line adapter that replaces the need for the legacy 800+ line
Transactionclass explain logic. The heavy lifting (parsing, instruction combining, type derivation) happens in@bitgo/wasm-solana— this adapter only handles:sol:usdcvia@bitgo/statics)StakingAuthorize→StakingAuthorizeRawtype mapping for downstream compatibilityTransactionExplanationinterfaceChanges
explainTransactionWasm.ts(new): Standalone adapter that calls@bitgo/wasm-solana'sexplainTransaction(), resolves token names, maps staking authorize fields, and returnsTransactionExplanationincludinginputsandfeePayertransaction.ts: Route tsol through WASM-based explain (validates against production traffic before replacing legacy for all networks)sol.ts: AddexplainTransactionWithWasm()method at coin class leveliface.ts: AddataOwnerMapandstakingAuthorizetoTransactionExplanationinterfaceinstructionParamsFactory.ts: Add Jito stake pool operations (StakePoolDepositSol,StakePoolWithdrawStake)jitoWasmVerification.ts: New test file verifying Jito liquid staking explain outputtransaction.tstests: Updated assertions for WASM parity (fee defaults to '0' instead of 'UNAVAILABLE', ataOwnerMap, inputs, feePayer, token name via statics)sol.tstests: Updated explain assertions to includeinputsandfeePayerreturned by WASM pathwebpack config: Add WASM asset handling for@bitgo/wasm-solanapackage.json: Add@bitgo/wasm-solanadependencyKey decisions
tsol) to validate against production traffic before replacing the legacy path for mainnetfee: '0'andfeeRate: undefinedwhen fee info not provided (instead of'UNAVAILABLE'). Downstream already converts UNAVAILABLE → '0', so this is a no-op changeStakingAuthorizeRawtype name, so the adapter maps it@bitgo/statics. Tokens not in statics return the raw mint addressinputsandfeePayer— these fields were already on theTransactionExplanationinterface but weren't populated by the WASM path until nowDepends on
explainTransaction()withStakingAuthorizeInfo, optionallamportsPerSignature(defaults to 5000n)Test Plan
Transactionclass output for all transaction typesTICKET: BTC-3025